import uvicorn
import main
from src.core.config import Config

if __name__ == "__main__":
    server_post = Config.SERVER_PORT
    server_host = Config.SERVER_HOST
    uvicorn.run(main.app,  # 直接传对象，而不是字符串 "main:app"
                host=server_host,  #"0.0.0.0", # host="::",      # ← 监听所有 IPv4 和 IPv6 地址
                port=server_post,  # 8080
                reload=False)
    # 启动 Uvicorn 服务器
    # uvicorn.run("main:app", host="127.0.0.1", port=8080,reload=False)
    # uvicorn.run("main:app", host="127.0.0.1", port=8080, reload=True)
